# name : normal.n.delta.mdd
# key: normal.n.delta.mdd
# contributor: Shuguang Sun
# --
${1:deltamdd} <- function (ratio = 1, delta0 = 1, sd = 1, alpha = 0.025, sided = 1, n = 200) {
  c <- 1/(1 + ratio)
  psi <- c * (1 - c)
  if (is.null(delta0)) {
      delta0 <- 0
  }
  zalpha <- -stats::qnorm(alpha/sided)
  deltaHat <- zalpha * sd /sqrt(n * psi) + delta0
  deltaHat
}
$1(n = ${2:100})
